<?php
    echo $this->Html->css(array(
    	'jquery/jqgrid/4.6.0/ui.jqgrid'
    ), array('inline'=>false));
    
    echo $this->Html->script(array(
        'jquery/jqgrid/4.6.0/grid.locale-es',
        'jquery/jqgrid/4.6.0/jquery.jqGrid.min',
        'app/clientes/lib_clientesGestion',   
    ), array('inline'=>false));
    
    $anchoTabla = 1000;
?>

<script type="text/javascript">
$(window).load(function(){
	anchoTabla = <?php echo $anchoTabla; ?>;
	clientesArrayJSON = <?php echo json_encode($clientesArrayJSON); ?>;
    fnInicializarTabla("#listaClientes");
});
</script>
<?php if(isset($msjRegistroCliente)) {?>
<script type="text/javascript">
jAlert('<?php echo $msjRegistroCliente; ?>',TITULO_MENSAJE);
</script>
<?php }?>
<div class="subtitulo">
	<div class="divBannerCabecera" align="left">
		<table border="0" cellpadding="1">
			<tr>
			<td><img src="<?php echo Router::url('/img/iconos/icono_clientes.png',false); ?>" width="45" height="45" border="0" alt="" title="" /></td>
			<td width="3%"></td>
			<td>Consulta de Clientes</td>
			</tr>
		</table>
	</div>
</div>
<br />
<fieldset class="fieldsetForm">
	<legend class="ui-widget-header">Datos de B&uacute;squeda</legend>
	<div align="center">
	<form id="formBusqueda" name="formBusqueda" action="<?php echo Router::url("/Clientes/consultar_clientes"); ?>" method="post">
		<table border="0">
			<tr>
				<td align="right">Ruc : </td>
				<td align="left"><input type="text" id="ruc" name="ruc" value="<?php echo $condiciones["ruc"]; ?>" /></td>
				<td align="center" width="1%"></td>
				<td align="right">Raz&oacute;n Social : </td>
				<td align="left"><input type="text" id="razonSocial" name="razonSocial" value="<?php echo $condiciones["razonSocial"]; ?>" /></td>
				<td align="center" width="1%"></td>
				<td align="right"></td>
				<td align="left"></td>
				<td align="center" width="1%"></td>
				<td align="right"></td>
				<td align="left"></td>
				<td align="center" width="1%"></td>
				<td align="center"></td>
			</tr>
			<tr>
				<td align="right">Ap. Paterno : </td>
				<td align="left"><input type="text" id="apPaterno" name="apellidoPaterno" value="<?php echo $condiciones["apellidoPaterno"]; ?>" /></td>
				<td align="center" width="1%"></td>
				<td align="right">Ap. Materno : </td>
				<td align="left"><input type="text" id="apMaterno" name="apellidoMaterno" value="<?php echo $condiciones["apellidoMaterno"]; ?>" /></td>
				<td align="center" width="1%"></td>
				<td align="right">Nombres : </td>
				<td align="left"><input type="text" id="nombres" name="nombres" value="<?php echo $condiciones["nombres"]; ?>" /></td>
				<td align="center" width="1%"></td>
				<td align="right">DNI : </td>
				<td align="left"><input type="text" id="dni" name="dni" value="<?php echo $condiciones["dni"]; ?>" /></td>
				<td align="center" width="1%"></td>
				<td align="center">
				<input id="btnBuscar" type="button" value="Buscar"
			onclick="fnBuscar();" class="btn btnposicion"
   			style="background-image: url(<?php echo Router::url('/img/iconos/buscar.png',false); ?>)" />
				</td>
			</tr>
		</table>
	</form>
	</div>
</fieldset>
<br />
<div class="barraHerramientas" style="width:<?php echo $anchoTabla?>px;">            
    <input type="button" value="Agregar"
			onclick="fnNuevoCliente();" class="btn btnposicion"
			style="background-image: url(<?php echo Router::url('/img/iconos/agregar.png',false); ?>)" />
		   			
	<input type="button" value="Editar"
			onclick="fnEditarCliente();" class="btn btnposicion"
			style="background-image: url(<?php echo Router::url('/img/iconos/editar.png',false); ?>)" />

</div>
<div id="divTablaClientes" align="center">
		<table id="listaClientes"></table>
		<div id="pagerClientes"></div>
</div>